/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: Igb driver Vendor Hooks
 */

#ifdef CONFIG_VENDOR_IGB_HOOKS

#undef TRACE_SYSTEM
#define TRACE_SYSTEM igb

#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_IGB_HOOKS_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_IGB_HOOKS_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>

struct net_device;
struct e1000_hw;
struct igb_adapter;
struct sk_buff;
struct ifreq;
struct e1000_mac_info;

DECLARE_HOOK(vendor_igb_remove,
	TP_PROTO(struct net_device *netdev),
	TP_ARGS(netdev));

DECLARE_HOOK(vendor_igb_init,
	TP_PROTO(struct igb_adapter *adapter),
	TP_ARGS(adapter));

DECLARE_HOOK(vendor_igb_open,
	TP_PROTO(struct igb_adapter *adapter, int *retval),
	TP_ARGS(adapter, retval));

DECLARE_HOOK(vendor_igb_close,
	TP_PROTO(struct net_device *netdev),
	TP_ARGS(netdev));

DECLARE_HOOK(vendor_igb_random_mac,
	TP_PROTO(struct net_device *netdev, struct e1000_hw *hw),
	TP_ARGS(netdev, hw));

DECLARE_HOOK(vendor_igb_eth_name,
	TP_PROTO(struct net_device *netdev, unsigned int bus_num),
	TP_ARGS(netdev, bus_num));

DECLARE_HOOK(vendor_igb_get_skb,
	TP_PROTO(struct igb_adapter *adapter, struct sk_buff **skb,
			 unsigned int *packets, unsigned int *retval),
	TP_ARGS(adapter, skb, packets, retval));

DECLARE_HOOK(vendor_igb_ioctl,
	TP_PROTO(struct net_device *netdev, struct ifreq *ifr, int cmd, int *retval),
	TP_ARGS(netdev, ifr, cmd, retval));

DECLARE_HOOK(vendor_igb_set_spd_dplx,
	TP_PROTO(struct e1000_mac_info *mac),
	TP_ARGS(mac));

DECLARE_HOOK(vendor_igb_phy_force_speed_duplex_setup,
	TP_PROTO(struct e1000_mac_info *mac, unsigned int *ctrl, unsigned short *phy),
	TP_ARGS(mac, ctrl, phy));

#endif
/* This part must be outside protection */
#include <trace/define_trace.h>

#else

#include <linux/tracepoint.h>
struct net_device;
struct e1000_hw;
struct igb_adapter;
struct sk_buff;
struct ifreq;
struct e1000_mac_info;

DECLARE_EVENT_NOP(vendor_igb_remove,
	TP_PROTO(struct net_device *netdev),
	TP_ARGS(netdev));

DECLARE_EVENT_NOP(vendor_igb_init,
	TP_PROTO(struct igb_adapter *adapter),
	TP_ARGS(adapter));

DECLARE_EVENT_NOP(vendor_igb_open,
	TP_PROTO(struct igb_adapter *adapter, int *retval),
	TP_ARGS(adapter, retval));

DECLARE_EVENT_NOP(vendor_igb_close,
	TP_PROTO(struct net_device *netdev),
	TP_ARGS(netdev));

DECLARE_EVENT_NOP(vendor_igb_random_mac,
	TP_PROTO(struct net_device *netdev, struct e1000_hw *hw),
	TP_ARGS(netdev, hw));

DECLARE_EVENT_NOP(vendor_igb_eth_name,
	TP_PROTO(struct net_device *netdev, unsigned int bus_num),
	TP_ARGS(netdev, bus_num));

DECLARE_EVENT_NOP(vendor_igb_get_skb,
	TP_PROTO(struct igb_adapter *adapter, struct sk_buff **skb,
			 unsigned int *packets, unsigned int *retval),
	TP_ARGS(adapter, skb, packets, retval));

DECLARE_EVENT_NOP(vendor_igb_ioctl,
	TP_PROTO(struct net_device *netdev, struct ifreq *ifr, int cmd, int *retval),
	TP_ARGS(netdev, ifr, cmd, retval));

DECLARE_EVENT_NOP(vendor_igb_set_spd_dplx,
	TP_PROTO(struct e1000_mac_info *mac),
	TP_ARGS(mac));

DECLARE_EVENT_NOP(vendor_igb_phy_force_speed_duplex_setup,
	TP_PROTO(struct e1000_mac_info *mac, unsigned int *ctrl, unsigned short *phy),
	TP_ARGS(mac, ctrl, phy));

#endif
